Peters School of Business · Assiniboine College · NETW-0001
Operating Systems Fundamentals · 5 days · 2 hours/day + Friday mini-assessment
Redirects, pipes, text editors, compression, and cron — the vocabulary of Linux administration
Week 4 is deliberately placed before scripting because these tools are the vocabulary that makes scripting possible. A student who can't confidently redirect output to a file, pipe commands together, or edit a config file in nano will struggle to write meaningful Bash scripts in Week 5. By Friday every student can chain commands, schedule tasks with cron, compress archives three different ways, and edit files without leaving the terminal.
Week at a glance
>, >>, 2>, |, tee, xargs — chaining commands and capturing output
nano fluency, vim basics, $PATH, export, .bashrc, environment variables
tar, gzip, bzip2, lzma — create, list, extract, append, compare sizes
crontab syntax, user and system crontabs, verify with syslog
Written: cron syntax, compression theory. Practical: pipe/redirect challenge + cron job.
Week 4 target: Levels 11–14
Level 11 uses tr for character rotation (ROT13). Level 12 involves a hex dump that must be decompressed multiple times using gzip, bzip2, and tar — a perfect match for Wednesday's compression lab. Level 13 introduces SSH private key authentication, which previews Week 6. Level 14 uses netcat for network communication.
I/O redirection and pipes — the glue that holds Linux together
> sends stdout to a file (overwrites). >> appends. 2> redirects errors. 2>&1 merges stderr into stdout. /dev/null — the black hole. Pipes (|) connect stdout of one command to stdin of the next — no temp files needed. tee splits: sends to file AND stdout simultaneously. xargs converts stdin into arguments for another command. Bridge: Windows PowerShell has pipes too (|) — same concept, but Linux pipes are older and more fundamental to the OS design.ls -l /etc to a file. Append the date to the same file. Redirect errors from a permission-denied command to a separate error log. Build pipelines: ls /etc | grep conf | wc -l. Use tee to log output while still seeing it on screen. Use xargs to delete a list of files. Challenge: use a pipeline to find the five largest files in /var/log, sorted by size.Text editors and environment — nano, vim basics, PATH, and .bashrc
i to insert, Esc to normal, :w to write, :q! to quit without saving. Environment variables: $HOME, $USER, $PATH, $SHELL. echo $PATH — the colon-separated list of directories searched for commands. export VAR=value — make a variable available to child processes. .bashrc and .bash_profile — where persistent customisations live. which command — find where a command lives in PATH./etc/hosts safely in nano — add a custom hostname entry, save, verify with ping. Open a file in vim, navigate, make a change, save, and quit. Inspect $PATH — identify which directories it contains. Add a custom directory to PATH in .bashrc and source it. Create a simple alias in .bashrc (alias ll='ls -la'). Verify it persists after opening a new terminal.Compression and archives — tar, gzip, bzip2, lzma
-z for gzip (.tar.gz), -j for bzip2 (.tar.bz2), -J for lzma/xz (.tar.xz). Key tar switches: -c create, -x extract, -t list, -f file, -v verbose, -r append (uncompressed only), --delete remove from archive. Relative vs. absolute paths in archives — leading / stripped by default for safety. Compression comparison: gzip is fastest, bzip2 better compression, lzma/xz best compression but slowest./usr/src/* using gzip, bzip2, and lzma — compare resulting sizes and determine which compresses best for that data.Cron — scheduling automated tasks
crontab -e edits the current user's cron jobs. crontab -l lists them. crontab -r removes all (dangerous — warn students). Cron syntax: five fields — minute (0–59), hour (0–23), day of month (1–31), month (1–12), day of week (0–6, 0=Sunday). Special values: * any, */5 every 5, 1,15 first and fifteenth. System-wide crontabs live in /etc/crontab and /etc/cron.d/ — these have an extra user field. Cron output goes to the user's mail by default; redirect to a file with >> and 2>&1. Verify execution with grep CRON /var/log/syslog.sudo crontab -e. Answer: what command shows current time in terminal? (date)anacron vs. cron — what happens to missed jobs when the system was off? Introduce /etc/cron.daily, /etc/cron.weekly drop-in directories.Mini-Assessment 4 — CLI Power Tools
| Topic | Weight | Format |
|---|---|---|
| Cron syntax reading and writing | 15% | Written + Practical |
| Redirection operators (>, >>, 2>, 2>&1) | 10% | Written |
| Compression formats and trade-offs | 5% | Written |
| Pipeline construction challenge | 30% | Practical |
| Compression/archive tasks | 20% | Practical |
| Cron job creation and verification | 20% | Practical |
What you need ready before Monday